package com.znzz.dao;

import com.znzz.entity.News;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public interface NewsDao {
    /**
     * 添加新闻
     * @return
     */
    int addNews(News news);

    /**
     * 删除新闻
     */
    boolean deleteNews(Integer newsId);

    /**
     * 修改新闻
     */
    boolean updateNews(@Param(value = "news") News news);

    /**
     * 查询新闻
     */
    List<News> queryNewsByCondition(Map<String,Object> map);

    /**
     * 分页查询所有新闻内容
     */
    List<News> findAllNews(@Param(value = "pageNum") Integer pageNum, @Param(value = "size") Integer pageSize);

    int countAllNews();

    News findById(Integer id);
}
